package com.dyna.demo.tree.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhoucaiwang
 * @date 2023/9/9
 */

@Data
public class TreeDto {

    private Integer id;

    private String key;

    private Integer parentId;

    private String value;

    private List<TreeDto> children = new ArrayList<>();

    public TreeDto(Integer id, String key, Integer parentId, String value) {
        this.id = id;
        this.key = key;
        this.parentId = parentId;
        this.value = value;
    }

    @Override
    public String toString() {
        return "TreeDto{" +
                "id=" + id +
                ", key='" + key + '\'' +
                ", parentId=" + parentId +
                ", value='" + value + '\'' +
                ", children=" + children +
                '}';
    }

}
